home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / cal_v201 < prev    next >
Internet Message Format  |  1995-03-31  |  23KB

  1. From: Kevin Jessup <kevin.jessup@mixcom.mixcom.com>
  2. Subject:  v03i018:  cal_v201 - Calendar v2.01, Part01/01
  3. Newsgroups: comp.sources.hp48
  4. Followup-To: comp.sys.hp48
  5. Approved: spell@seq.uncwil.edu
  6.  
  7. Checksum: 3870485936 (verify with brik -cv)
  8. Submitted-by: Kevin Jessup <kevin.jessup@mixcom.mixcom.com>
  9. Posting-number: Volume 3, Issue 18
  10. Archive-name: cal_v201/part01
  11.  
  12.  
  13. BEGIN_RDME cal_v201.rdm
  14.  
  15.   Just when you thought it was safe to go back on the net you find...
  16.  
  17.  
  18.                THE CALENDAR PROGRAM THAT WOULD NOT DIE!
  19.  
  20.  
  21. ***********************************************************************
  22. *      DOCUMENTATION FILE FOR HP48SX CALENDAR DRAWING FUNCTIONS       *
  23. *                           Version 2.01                              *
  24. *                                                                     *
  25. *                by Kevin Jessup  January 20th, 1992                  *
  26. ***********************************************************************
  27.  
  28.  
  29. These programs will draw a calendar on the display of the HP48 for any
  30. month and year.  Days that have an alarm due will be highlighted.
  31.  
  32.  
  33. Revision History
  34. ----------------
  35.  
  36. Version 1.00
  37.   Originally appeared on the net in early 1990.  It had a bug that
  38.   caused it to crash if no alarms were due after the date it was
  39.   processing.
  40.  
  41. Version 1.01
  42.   Claimed to fix the bug but did not.
  43.  
  44. Version 1.02
  45.   Worked, but was very slow.
  46.  
  47. Version 1.03
  48.   Was a bit faster.
  49.  
  50. Version 2.00
  51.   This version is a major rewrite of all the code.  It is now fairly
  52.   well integrated into the existing HP48 alarm functions and executes
  53.   in 1/3 the time of the original!  The original program ran by
  54.   building a GROB every step of the way.  This version works entirely
  55.   in text mode before going to a GROB.  At that point, the GROB is only
  56.   used for highlighting days that have an alarm due.  It's also smaller
  57.   (by 383 bytes) than version 1.03.
  58.  
  59. Version 2.01
  60.   Version 2.00 required the display mode to be set to STD prior to
  61.   entry.  Version 2.01 fixes the bug.  Some of the code changed a bit
  62.   but it functions as in version 2.00.  It's even a bit faster.
  63.  
  64.  
  65. Other Calendar Programs
  66. -----------------------
  67. The idea for the single, long text string of 31 days was taken from the
  68. program CALGEN9 by Eric B. Davis, Eddie Wilborne and Pete Wilson.
  69. CALGEN9 is still the fastest freeware calendar maker I have seen for the
  70. HP48.  But, CALGEN9 does not display the alarms.
  71.  
  72. CALENDAR V2.0X not only displays the alarms, but provides a menu with hooks
  73. into existing HP48 alarm functions.  This version of CALENDAR also does
  74. not care about the date mode (MM.DDYYYY or DD.MMYYYY), unlike CALGEN9.
  75.  
  76. SET EDITORIAL ON
  77. By-the-way, would it not be nice if the 48 returned a date to the stack
  78. in the format YYYYMMDDHH.fraction_of_hours regardless of mode?  You could
  79. then process any two dates and times using >, < or == without all the
  80. messing around!
  81. SET EDITORIAL OFF
  82.  
  83. END_RDME
  84.  
  85.  
  86. BEGIN_DOC cal_v201.doc
  87.  
  88. Operation
  89. ---------
  90. Transfer the ASC version or the commented ASCII source code to the HP48.
  91. Recall the entire directory to the stack and run BYTES.  Verify the
  92. following...
  93.               Checksum:   64426 decimal
  94.               Byte count: 2637
  95.  
  96. Go to the calendar directory and press GO.  The calendar for the current
  97. month will be drawn.  Days that have alarms due will be highlighted.
  98. The following menu will then appear...
  99.  
  100.             [MON-]  [MON+]  [ANY]  [TODAY]  [CAT]  [DNAL]
  101.  
  102.      Menu Key     Function
  103.      --------     --------------------------------------------
  104.        MON-       Move back a month.
  105.        MON+       Advance to the next month.
  106.        ANY        Prompts for month and year.
  107.                   Modify the month and year, then press ENTER.
  108.                   The last drawn month is the default.
  109.       TODAY       Draws a calendar for the current month.
  110.        CAT        Activates the HP48 alarm catalog.
  111.       DNALM       Displays the next due alarm
  112.  
  113.  
  114. Press NXT to move to the next menu.
  115.  
  116.  
  117.             [SET]  [PCAL]  [ABOUT]  [   ]  [   ]  [EXIT]
  118.  
  119.      Menu Key     Function
  120.      --------     -------------------------------------------------
  121.        SET        Exits the application and places you in the
  122.                   HP48 alarm-set menu.
  123.        PCAL       Prints the calendar on the IR printer.
  124.        ABOUT      A little message.
  125.        [  ]       An unused key.  Beeps.
  126.        [  ]       An unused key.  Beeps.
  127.        EXIT       Leave the calendar application.
  128.  
  129.  
  130. !WARNING!
  131. ---------
  132. Certain functions make use of calls to internal HP48 system-RPL
  133. routines.  I have only tested this on a Rev E HP48.
  134.  
  135.  
  136. I hope you like this version better than the original.  This is
  137. freeware.  Of course, any donations are appreciated :-)))
  138.  
  139.  
  140. Send flames to:
  141.  
  142.     alt.null
  143.  
  144. Send suggestions, accolades and government grants to:
  145.  
  146.     Kevin Jessup
  147.     9118 N 85th St.
  148.     Milwaukee, WI 53224
  149.  
  150. END_DOC
  151.  
  152.  
  153.  
  154. Here is the ASC-encoded CALENDAR directory.
  155.  
  156. BEGIN_ASC cal_v201.asc
  157. %%HP: T(3)A(D)F(.);
  158. "69A20FF7C4D0000000700594344537572670D9D20E1632634E147A20E4A20510
  159. 000000000000000000E4A20510000000000000000000B213047A20E4A2051000
  160. 2800000000000000E4A20510008300000000000000B2130C58C193632B2130CA
  161. 00070449435053414C470D9D20E163284E207005943445375726D85E13F2A24A
  162. 5A193632B2130A4000607454E43414C460D9D20E1632858A184E20703416C644
  163. 16475678BF184E20402544F475DBBF184E20304494D41C432D6E204046F67713
  164. D6E20304696D6E1632C2A20F2000020202020202020202020202020202020202
  165. 02020247A20C2A2031000A416E657162797C2A20510006456262757162797C2A
  166. 20F0000D416273686C2A20F000014072796C6C2A20B0000D41697C2A20D0000A
  167. 457E656C2A20D0000A457C697C2A2011000145776573747C2A20710003556074
  168. 756D6265627C2A2031000F43647F6265627C2A2051000E4F66756D6265627C2A
  169. 205100044563656D6265627B213084E20703416C644164756D6BB16C7D1C2A20
  170. 700000276BA184E20703416C644164756339202000000000000010EEDA13ABB1
  171. 339204000000000000010EEDA176BA133920100000000000022092CF18B9C190
  172. DA1ED2A250FA1D6BB19C2A276BA1DBBF1AE8C13CE22D6E204046F67713AFE22D
  173. 9D20C2A20920000202020202020202020202020202020202029C2A2D6E204046
  174. F677133F2A2EEDA1C58C176BA1B21305DF22C2A20FB000020213020223020233
  175. 0202430202530202630202730202830202930213030213130213230213330213
  176. 4302135302136302137302138302139302230302231302232302233302234302
  177. 23530223630223730223830223930233030233139C2A2D6E20304696D63F2A2E
  178. EDA1C58C176BA13CE2278BF18B9C1339202000000000008210EBBE1AFE22D9D2
  179. 078BF19C2A2339201000000000000120C58C1C2A20F200002355702D4F602455
  180. 702755602458602642702351676BA1DBBF133920100000000000022092CF18B9
  181. C1C58C176BA1D13A2472C1B21305BF22D9D20D13A25D2C1B21305DF229C2A292
  182. CF18B9C133920100000000000012050FA178BF1D6BB1DBBF13CE223ABB1AFE22
  183. D9D209C2A276BA1B21305DF220A132D6E20109678BF1D6E20109633920100000
  184. 0000000120EEDA178BF133920100000000000002090DA1DBBF1C58C1D6E20109
  185. 6485A1C42328DBF1275E1634E1DCC0284E20703416C6441647563C032FD33284
  186. 991F1732D9D208DBF14B2A2B21305BF22D9D203CE2278BF1AFE22D9D20829919
  187. C2A26C7D178BF178BF13ABB1339202000000000000010EEDA1D6BB1DBBF13CE2
  188. 278BF1D6BB184E20703416C644164756D6BB1279E1DBBF133920200000000000
  189. 0010EEDA13ABB184E20703416C644164756339202000000000000010EEDA13AB
  190. B1279E1387E1AFE22D9D20D6E204046F6771376BA19C2A290DA178BF1743A2D4
  191. EB1339201000000000000810EEDA1D13A276BA1B9691DBBF1743A250FA1D6BB1
  192. 3CE22D13A2313C1AFE22D9D209C2A276BA1B21305DF22C53A2EEDA1C53A276BA
  193. 1B9691ED2A2387C1634E1DBBF1E4A2051000D000000000000000E4A205100070
  194. 00000000000000614E1599A14E4E19C2A22D9919C2A2B21305BF22D9D203FBF1
  195. 4B2A2B21305DF22B21305DF22B21305DF22DE032F88E19B63284E20704494350
  196. 53414C4EF53293632B2130488009005255465D4F4E4458490D9D20E163278BF1
  197. 3CE22ED2A2EBBE1AFE22D9D203ABB133920100000000000021076BA133920499
  198. 000000000001090DA1B21305BF22D9D209C2A290DA1B21305DF2293632B21304
  199. A00090E4548545D4F4E4458490D9D20E163278BF13CE22339201000000000000
  200. 210D5CE1AFE22D9D203ABB133920499000000000001076BA1B21305DF229C2A2
  201. 76BA193632B2130B8000304494D430D9D20E163278BF184E2090E4548545D4F4
  202. E445842B99193632B213014000703416C6546514C470D9D20E1632916C11C432
  203. D6E201066E1632684C13392010000000000002495D2C1EB3A1D6E201066F76C1
  204. EF53293632B2130570006014C4D434144560D9D207EA74B2130F10005044E414
  205. C4D450D9D202ED91B2130D1000402544F47540D9D2005EE0D20F0B969150FA1B
  206. B691233A276BA1743A2D4EB1B213034000405485944540D9D20E1632606E147A
  207. 20634E184E20400505142584E20703416C644164756B2130EFE024B2A2691129
  208. 3632B2130760005045F444149550D9D20E1632C9432D9D20E163221891B0BC17
  209. 8BF1C2A2070000E24BAC1C2A20B0000E20313AE8C1B7FC14563284E20703416C
  210. 64416475697632DCC0284E20607454E43414C493632B213084E20703416C6546
  211. 514C493632B21301C0002074F420D9D20E163284E205045F444149547A2047A2
  212. 0C2A20D0000D4F4E4D2D9D20E1632C9432D9D20E163284E20703416C64416475
  213. 684E209005255465D4F4E445844563284E20703416C64416475697632DCC0284
  214. E20607454E43414C493632B213084E20703416C6546514C493632B2130B21304
  215. 7A20C2A20D0000D4F4E4B2D9D20E1632C9432D9D20E163284E20703416C64416
  216. 475684E2090E4548545D4F4E445844563284E20703416C64416475697632DCC0
  217. 284E20607454E43414C493632B213084E20703416C6546514C493632B2130B21
  218. 3047A20C2A20B000014E495D9D20E1632C9432D9D20E1632C2A20F200054E647
  219. 562702D6F6E647860216E6460297561627E247A20B2130C2A2051000A3D4F6E6
  220. 4786A30284E20703416C644164756D6BB176BA1C2A2051000A0A395561627A30
  221. 276BA184E20703416C644164756339202000000000000010EEDA13ABB1339204
  222. 000000000000010EEDA176BA176BA147A209C2A2173A2B213076BA147A2084E2
  223. 01065B213076BA1AC422B7FC133920600000000000001050FA13392089900000
  224. 0000001076BA176BA14563284E20703416C64416475697632DCC0284E2060745
  225. 4E43414C493632B213084E20703416C6546514C493632B2130B213084E205045
  226. F444149547A20C2A20B0000341445D9D20E1632C9432D9D20E163284E206014C
  227. 4D434144584E20607454E43414C493632B213084E20703416C6546514C493632
  228. B2130B213047A20C2A20F000044E414C4D4D9D20E1632C9432D9D20E1632858A
  229. 184E205044E414C4D44B2A2F17A18DBF184E20607454E43414C493632B213084
  230. E20703416C6546514C493632B2130B213047A20C2A20B0000355445D9D20E163
  231. 284E2040548594453392010000000000007306911293632B2130B213047A20C2
  232. A20D0000053414C4D9D20E16324AEE184E20700594344537572635EE18DBF14A
  233. EE14AEE14AEE193632B2130B213047A20C2A20F00001424F45545D9D20E16328
  234. 58A1C2A2092000020202023416C656E6461627026523E203139C2A2485A1C2A2
  235. 0D1000020202020202020202022697ED2A2485A1C2A20720000202020202B456
  236. 6796E602A456373757073F2A2485A1C2A20D20000202D496C6771657B6565602
  237. 8405438302242435D13A2485A1C2A209200002020202824313439202336323D2
  238. 23032303233A2485A1C2A2092000020202026305D40247F6027314D402343545
  239. 743A2485A13F2A24A5A193632B2130B213047A20B213047A20B213084E204054
  240. 859445B2130D511293632B2130AABF"
  241. END_ASC
  242.  
  243. BYTES: #FBAAh 2644.5
  244.  
  245. BEGIN_UU cal_v201.uue
  246. begin 644 cal_v201
  247. M2%!(4#0X+466*O!_3`T````'4$E#5'-U8@>=+>!A(S;D0:<"3BI0`0``````M
  248. M`````$XJ4`$````````````K,4"G`DXJ4`$`@@````````!.*E`!`#@`````R
  249. M````*S'`A1PY-K(2`ZP`<$"4-`4U%,1TT-D"'C:"Y`('4$E#5'-U8HWE,2\JP
  250. MI*618R,K,:`$``9'14Y#04P&G2W@82-8J('D`@=#86Q$871EA_N!Y`($4D1/0
  251. M5[W[@>0"`T1)3<$TTN8"!&1O=S%M+C!`EM;F82,L*O`"`"`@("`@("`@("`@+
  252. M("`@("`@("`@('0JP*("$P"@%.96%R:7QZ("%0!@5"8F5Q<FE\>B`@\`T!0F[
  253. M-X;&H@(/`!`$)Y?&QJ(""P#0%);'H@(-`*!4YU;&H@(-`*!4QY;'H@(1`!!45
  254. M=U8W1\>B`A<`,%4&1U?6)E8FQZ("$P#P-$;W)E8FQZ("%0#@]&97UB96)L>B#
  255. M`A4`0%0V5M8F5B:W$@-(+G`P%,9&%$97UK8;QM?!H@('``!RMAI(+G`P%,9&(
  256. M%$97-I,"`@````````'NK3&Z&S,I0````````!#@WAIGJS&3`@$``````"`"X
  257. M*?R!FQP)K>$M*@6OT;8;R:)RMAJ]^Z&.',,NTN8"!&1O=S'Z+M+9`BPJD`(`$
  258. M("`@("`@("`@("`@("`@("`@R:+2Y@($9&]W,?.BXMX:7,AQMAHK,5#](BPJJ
  259. M\`L`("`Q("`R("`S("`T("`U("`V("`W("`X("`Y(#$P(#$Q(#$R(#$S(#$TD
  260. M(#$U(#$V(#$W(#$X(#$Y(#(P(#(Q(#(R(#(S(#(T(#(U(#(V(#(W(#(X(#(YI
  261. M(#,P(#,QR:+2Y@(#9&EM\Z+BWAI<R'&V&L,N<K@?N,DQDP("```````H`;[K*
  262. MH>\BG2UPN!_)HC*3`@$``````!`"7,C!H@(O```R50?2]`9"50=R509"A09B.
  263. M)`<R%7:V&KW[,9,"`0``````(`(I_(&;'%S(<;8:':-")QPK,5#[(ITMT#$J5
  264. MU<*Q$@/5+Y(L*BG\@9L<,RD0````````(5#P&H?[T;8;O?LQ["*CNZ'O(ITMM
  265. MD"PJ9ZNQ$@/5+P(:(VTN$)!VN!]M+A"0-I,"`0``````$`+NK7&X'S,I$```6
  266. M`````""0T!J]^\&%'&TN$)!&6!I,,H*]'W+E84,>S0R"Y`('0V%L1&%T9<,PZ
  267. M\CTC2)GQ<2.=+8"]'[2BLA(#M2_2V0+#+G*X'_HNTMD"*)F1+"K&UW&X'X?[X
  268. M,;H;,RD@````````$.#>&FV[T;L?PRYRN!]MNX'D`@=#86Q$871E;;LAEQZ]E
  269. M^S&3`@(````````![JTQNAM(+G`P%,9&%$97-I,"`@````````'NK3&Z&W+I4
  270. M,7@>^B[2V0)M+D!`]G87<[8:R:*2T!J'^W$T*DV^,9,"`0``````@`'NK=$Q(
  271. M*F>KL6D9O?MQ-"H%K]&V&\,NTC$J$\.A[R*=+9`L*F>KL1(#U2_"-2KNK<$U9
  272. M*F>KL6D9WJ(R>!PVY-&['TXJ4`$`#0````````!.*E`!``<`````````%N117
  273. MF1KDY)$L*M*9D2PJ*S%0^R*=+3"_'[2BLA(#U2^R$@/5+[(2`]4OT@XCC^B1:
  274. M:R-(+G!`E#0%-13$Y%\C.3:R$@.$")``)55DU?3D1(64T-D"'C9RN!_#+N(MQ
  275. M*K[KH>\BG2TPNALS*1`````````2<+8:,RE`F0``````$)#0&BLQ4/LBG2V0^
  276. M+"H)K;$2`]4ODF,C*S%`"@`)3D585$U/3E1("9TMX&$CA_LQ["(S*1``````#
  277. M```2T,4>^B[2V0*CNS&3`I0)```````!9ZNQ$@/5+Y(L*F>KD6,C*S&P"``#M
  278. M1$E-`YTMX&$CA_N!Y`()3D585$U/3E1(LIF18R,K,1`$``=#86Q%5D%,!YTM(
  279. MX&$C&<813"-M+A!@YF$CAL0QDP(!```````@E-7"X3L:;2X08/9G'/XUDF,C1
  280. M*S%0!P`&04Q-0T%4!ITM<*Y'*S'P`0`%1$Y!3$T%G2T@WADK,=`!``121$]7+
  281. M!)TM`.4.+?"P:1D%K[%K&3*C<K8:1Z/2Y!LK,3`$``1%6$E4!)TMX&$C!N9!"
  282. MIP(VY('D`@104$%22"YP,!3&1A1&5[82`_X.0BLJEA&28R,K,7`&``543T1!P
  283. M606=+>!A(YPTTMD"'C8B@1D+RW&X'RPJ<```+K3*P:(""P#@`A.CCAQ[ST%EY
  284. M(T@N<#`4QD841E>69R/-#(+D`@9'14Y#04PY-K(2`T@N<#`4QE9D%<248R,K9
  285. M,1`,``)'3P*=+>!A(T@N4$#U1!241:<"="K`H@(-`-#TY-32V0(>-L))(YTMX
  286. MX&$C2"YP,!3&1A1&5X;D`@E04D5634].5$A4-H+D`@=#86Q$871E>3;2S"!(=
  287. M+F!P5.0T%,248R,K,8#D`@=#86Q%5D%,.3:R$@,K,4"G`BPJT```34].*YTM1
  288. MX&$CG#32V0(>-H+D`@=#86Q$871E2"Z0X%2$1=7TY$2%1&4C2"YP,!3&1A1&$
  289. M5Y9G(\T,@N0"!D=%3D-!3#DVLA(#2"YP,!3&5F05Q)1C(RLQL!(#="K`H@(+K
  290. M`!#DE-79`AXVPDDCG2W@82,L*O`"`$5N=&5R(&UO;G1H(&%N9"!Y96%R+G0JG
  291. ML!(#+"I0`0`Z36]N=&@Z($@N<#`4QD841E?6MAMGJ\&B`A4`H*"3518FIP-RZ
  292. MMAI(+G`P%,9&%$97-I,"`@````````'NK3&Z&S,I0````````!#@WAIGJW&V(
  293. M&G0JD"PJ<:.R$@-GJT&G`D@N$&"U$@-GJZ%,(GO/,9,"!@````````$%KS&3!
  294. M`I@)```````!9ZMQMAI4-H+D`@=#86Q$871E>3;2S"!(+F!P5.0T%,248R,K8
  295. M,8#D`@=#86Q%5D%,.3:R$@,K,8#D`@543T1!670JP*(""P`P%$35V0(>-L))C
  296. M(YTMX&$C2"Y@$,34-!1$A>0"!D=%3D-!3#DVLA(#2"YP,!3&5F05Q)1C(RLQ[
  297. ML!(#="K`H@(/`$#D%,34U-D"'C;"22.=+>!A(UBH@>0"!41.04Q-M*+R<1K8>
  298. M^X'D`@9'14Y#04PY-K(2`T@N<#`4QE9D%<248R,K,;`2`W0JP*(""P`P54352
  299. MV0(>-H+D`@1%6$E4,RD0````````-V`9(3DVLA(#*S%`IP(L*M```%!#04R=V
  300. M+>!A(Z3N@>0"!U!)0U1S=6)3[H&]'Z3N0>H>I.Z18R,K,;`2`W0JP*("#P`0&
  301. M)/141=79`AXV@H4:+"J0`@`@("`@0V%L96YD87(@5C(N,#')HD)8&BPJT`$`?
  302. M("`@("`@("`@(&)YWJ)"6!HL*G`"`"`@("`@2V5V:6X@2F5S<W5P\Z)"6!HL#
  303. M*M`"`"`@36EL=V%U:V5E($A0-#@@0D)3':-"6!HL*I`"`"`@("`H-#$T*2`S$
  304. M-C(M,C`R,#*C0E@:+"J0`@`@("`@-E!-('1O(#=!32!#4U1'HT)8&O.B0EH:]
  305. C.3:R$@,K,4"G`BLQ0*<"*S&`Y`($15A)5"LQT!4A.3:R$@.R/
  306. ``
  307. end
  308. END_UU
  309.  
  310. Here is the commented HP48 ASCII directory.  You can download this
  311. AS IS to your 48.  Make sure you run the SETUP program (described
  312. below) first!
  313.  
  314. BEGIN_RPL cal_v201
  315. %%HP: T(3)A(D)F(.);
  316.  
  317. @ CALENDAR V2.01
  318. @ ASCII directory listing with comments.
  319. @ January 20th, 1992
  320. @ by Kevin Jessup
  321.  
  322.  
  323. @ Mark the beginning of the HP48 directory object.
  324. DIR
  325.  
  326. @ Object name: SETUP
  327. @ Object type: program
  328. @ Purpose: Uses ASC-> to decode objects in this directory
  329. @          that are ASC encoded.  Then deletes itself.
  330. @          Assumes you have the program ASC-> available
  331. @          somewhere in the path to this directory!
  332. @
  333. @ Note:    Before running SETUP, recall the entire
  334. @          CALENDAR directory to the stack.
  335. @          Execute BYTES and verify the following...
  336. @              Checksum:   62694 decimal
  337. @              Byte count: 2835
  338. @
  339. @          After running setup, verify the following...
  340. @              Checksum:   64426 decimal
  341. @              Byte count: 2637
  342.  
  343.   SETUP
  344.     \<<
  345.      'ALMCAT' DUP RCL ASC\-> SWAP STO
  346.      'DNALM' DUP RCL ASC\-> SWAP STO
  347.      'RDOW' DUP RCL ASC\-> SWAP STO
  348.      'SETUP' PURGE
  349.     \>>
  350.  
  351.  
  352. @ Object name: GO
  353. @ Object type: program
  354. @ Purpose: Main calendar routine entry point.
  355. @
  356. @          Press GO to start the calendar application.
  357. @          GO enables all calendar functions via a
  358. @          temporary menu.  You cannot guarantee proper
  359. @          operation of the CALENDAR functions unless you
  360. @          run them via this menu interface!  Most functions
  361. @          call CalEVAL to guarantee flag settings and to
  362. @          return the 48 flags to the state they were in prior
  363. @          to running the function.
  364.  
  365.   GO
  366.     \<<
  367.     TODAY
  368.     {
  369.         {
  370.             "MON-"
  371.             \<<
  372.             \<< CalDate PREVMONTH 'CalDate' STO GENCAL \>>
  373.             CalEVAL
  374.             \>>
  375.         }
  376.  
  377.         {
  378.             "MON+"
  379.             \<<
  380.             \<< CalDate NEXTMONTH 'CalDate' STO GENCAL \>>
  381.             CalEVAL
  382.             \>>
  383.           }
  384.  
  385.          {
  386.             "ANY"
  387.             \<< \<<
  388.             "Enter month and year." { } ":Month: " CalDate IP +
  389. @ Do NOT remove the line-feed in the following text string!
  390. "
  391. :Year: " + CalDate 100 * FP 10000 * + +  { 1 9 } + { V } +
  392.             INPUT OBJ\-> 1000000 / .01 + + 'CalDate'
  393.             STO GENCAL \>>
  394.             CalEVAL
  395.             \>>
  396.          }
  397.  
  398.          TODAY
  399.  
  400.          {
  401.             "CAT"
  402.             \<< \<< ALMCAT GENCAL \>>
  403.             CalEVAL \>>
  404.          }
  405.  
  406.          {
  407.             "DNALM"
  408.             \<<
  409.             \<< CLLCD DNALM 0 WAIT DROP GENCAL \>>
  410.             CalEVAL \>>
  411.          }
  412.  
  413.          {
  414.              "SET"
  415.              \<<
  416.              EXIT 37 MENU
  417.              \>>
  418.           }
  419.  
  420.           {
  421.              "PCAL"
  422.               \<< CR PICTsub PR1 DROP CR CR CR \>>
  423.           }
  424.  
  425.           {
  426.              "ABOUT"
  427.              \<<
  428.               CLLCD
  429.               "    Calendar V2.01"    1 DISP
  430.               "          by"          2 DISP
  431.               "     Kevin Jessup"     3 DISP
  432.               "  Milwaukee HP48 BBS"  5 DISP
  433.               "    (414) 362-2020"    6 DISP
  434.               "    6PM to 7AM CST"    7 DISP
  435.               3 FREEZE
  436.               \>>
  437.           }
  438.  
  439.           {}
  440.  
  441.           {}
  442.  
  443.           EXIT
  444.  
  445.     }
  446.     TMENU
  447.     \>>
  448.  
  449.  
  450. @ Object name: TODAY
  451. @ Object type: program
  452. @ Purpose: Get current date,
  453. @          save in global variable
  454. @          and draw the calendar.
  455.  
  456.   TODAY
  457.     \<<
  458.     \<< DATE \->STR DUP "." POS ".01" REPL OBJ\-> 'CalDate' STO GENCAL \>>
  459.     CalEVAL
  460.     \>>
  461.  
  462.  
  463. @ Object name: EXIT
  464. @ Object type: program
  465. @ Purpose: Purge global variables.
  466. @          Return to text mode.
  467. @          Display last menu prior to entry.
  468.  
  469.   EXIT
  470.     \<<
  471.     TEXT { PICT PPAR CalDate } PURGE 0 MENU
  472.     \>>
  473.  
  474.  
  475. @ Object name: RDOW
  476. @ Object type: program
  477. @ Purpose: Returns the day of week (0 = Sun, 6 = Sat)
  478. @          of the date on level 1.
  479. @          Warning: Uses SYSEVAL calls to
  480. @          internal HP48 system RPL.
  481. @ Note:   As listed here, this is an ASC encoded string.
  482. @          Use ASC-> to decode it before running!
  483.  
  484.   RDOW
  485. "D9D2005EE0D20F0B969150FA1BB691233A276BA1743A2D4EB1B21307B45"
  486.  
  487.  
  488. @ Object name: DNALM
  489. @ Object type: program
  490. @ Purpose: Display next alarm.
  491. @          Warning: Uses SYSEVAL calls to
  492. @          internal HP48 system RPL.
  493. @ Note:   As listed here, this is an ASC encoded string.
  494. @          Use ASC-> to decode it before running!
  495.  
  496.   DNALM
  497. "D9D202ED91B2130CD45"
  498.  
  499.  
  500. @ Object name: ALMCAT
  501. @ Object type: program
  502. @ Purpose: Activate the alarm catalog.
  503. @          Warning: Uses SYSEVAL calls to
  504. @          internal HP48 system RPL.
  505. @ Note:   As listed here, this is an ASC encoded string.
  506. @          Use ASC-> to decode it before running!
  507.  
  508.   ALMCAT
  509. "D9D207EA74B2130E98A"
  510.  
  511.  
  512. @ Object name: CalEVAL
  513. @ Object type: program
  514. @ Purpose: Insures proper flag settings
  515. @          required for all functions in
  516. @          this package.
  517.  
  518.   CalEVAL
  519.     \<< RCLF \-> f \<<
  520.     STD -42 CF EVAL f STOF \>>
  521.     \>>
  522.  
  523.  
  524. @ Object name: DIM
  525. @ Object type: program
  526. @ Purpose: Returns the number of days in the month
  527. @          for the date on stack level 1.  Assumes
  528. @          the following format: MM.01YYYY
  529.  
  530.   DIM
  531.     \<<
  532.     DUP NEXTMONTH DDAYS
  533.     \>>
  534.  
  535.  
  536. @ Object name: NEXTMONTH
  537. @ Object type: program
  538. @ Purpose: Returns the next month
  539. @          for the date on stack level 1.  Assumes
  540. @          the following format: MM.01YYYY
  541.  
  542.   NEXTMONTH
  543.     \<<
  544.         DUP
  545.         IF
  546.             12 >
  547.         THEN
  548.             FP .000001 +
  549.         END
  550.         1 + 
  551.     \>>
  552.  
  553.  
  554. @ Object name: PREVMONTH
  555. @ Object type: program
  556. @ Purpose: Returns the previous month
  557. @          for the date on stack level 1.  Assumes
  558. @          the following format: MM.01YYYY
  559.  
  560.   PREVMONTH
  561.     \<<
  562.         DUP
  563.         IF
  564.             2 <
  565.         THEN
  566.             FP 12 + .000001 -
  567.         ELSE
  568.             1 -
  569.         END
  570.     \>>
  571.  
  572.  
  573. @ Object name: GENCAL
  574. @ Object type: program
  575. @ Purpose: Draw the calendar and alarms based
  576. @          on the global CalDate variable.
  577.  
  578.   GENCAL
  579.     \<<
  580.     CLLCD CalDate DUP RDOW SWAP DIM
  581.  
  582.     \-> dow1 dim
  583.  
  584.         \<<
  585.         "                     "
  586.         {
  587.           "January"
  588.           "February"
  589.           "March"
  590.           "April"
  591.           "May"
  592.           "June"
  593.           "July"
  594.           "August"
  595.           "September"
  596.           "October"
  597.           "November"
  598.           "December"
  599.         }
  600.  
  601.         CalDate IP GET " " +
  602.         CalDate 100 * FP 10000 * +
  603.         22 OVER SIZE - 2 / IP 1 + SWAP REPL
  604.    
  605.         IF
  606.             dow1
  607.         THEN
  608.             "                  " 1 dow1 3 * SUB +
  609.         END
  610.  
  611.         "  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"
  612.         1 dim 3 * SUB +
  613.  
  614.         IF
  615.             DUP SIZE 128 <
  616.         THEN
  617.             DUP 1 21 SUB " Su Mo Tu We Th Fr Sa"
  618.             + SWAP 22 OVER SIZE SUB + 5 SF
  619.         ELSE
  620.             5 CF
  621.         END
  622.  
  623.         1 OVER SIZE 21 / DUP IP SWAP
  624.         IF
  625.             FP
  626.         THEN
  627.             1 +
  628.         END
  629.         FOR i
  630.             DUP i 21 * DUP 20 - SWAP SUB i DISP
  631.         NEXT
  632.         DROP LCD\-> PICT STO CalDate
  633.         DO
  634.             IFERR
  635.                 FINDALARM
  636.             THEN
  637.                 DROP 0
  638.             ELSE
  639.                 IF
  640.                     DUP
  641.                 THEN
  642.                     RCLALARM 1 GET DUP DUP FP 100 * IP SWAP
  643.                     IF
  644.                         DUP IP CalDate IP == SWAP 100 * FP CalDate
  645.                         100 * FP == AND
  646.                     THEN
  647.                         dow1 + 1 - DUP 7 MOD 18 * 5 + R\->B SWAP 7 / IP
  648.                         IF
  649.                             5 FS?
  650.                         THEN
  651.                             1 +
  652.                         END
  653.                         8 * 8 + R\->B 2 \->LIST PICT SWAP # 13d # 7d BLANK
  654.                         NEG GXOR 1 DATE+ 1
  655.                     ELSE
  656.                         DROP2 0
  657.                     END
  658.                 END
  659.             END
  660.         UNTIL
  661.             NOT
  662.         END
  663.         DISPCAL
  664.         \>>
  665.     \>>
  666.  
  667.  
  668. @ Object name: DISPCAL
  669. @ Object type: program
  670. @ Purpose: Get PICT and display it in the STACK area.
  671.  
  672.   DISPCAL
  673.     \<<
  674.     PICTsub \->LCD 3 FREEZE
  675.     \>>
  676.  
  677.  
  678. @ Object name: PICTsub
  679. @ Object type: program
  680. @ Purpose: Get only the portion of the
  681. @          PICT GROB that we built.
  682.  
  683.   PICTsub
  684.     \<<
  685.     PICT { # 0d # 0d } { # 130d # 56d } SUB
  686.     \>>
  687.  
  688. END
  689. END_RPL
  690.  
  691.         -- Kevin Jessup, bbwwbb@mixcom.mixcom.com
  692.  
  693.